<?php

namespace App\Exceptions;

use Symfony\Component\HttpKernel\Exception\HttpException;

class AppException extends HttpException
{
    public function __construct($message = '')
    {
        parent::__construct(422, $message);
    }

    public function getHeaders(): array
    {
        return [
            'Content-Type' => 'application/json',
        ];
    }

    public function getError()
    {
        return ['code' => 'common_error', 'message' => $this->getMessage()];
    }
}
